package com.example.agriculyural.Decoraror;

import com.example.agriculyural.FactoryMethod.AgriculturalMachine;
import com.example.agriculyural.Observer.EnvironmentData;
import com.example.agriculyural.Strategy.PathPlanningStrategy;

public abstract class MachineDecorator extends AgriculturalMachine {
    protected AgriculturalMachine machine;

    public MachineDecorator(AgriculturalMachine machine) {
        super(machine.getId()); // 调用父类构造函数
        this.machine = machine;
    }

    @Override
    public void performOperation() {
        machine.performOperation();
    }

    @Override
    public String getMachineType() {
        return machine.getMachineType();
    }

    @Override
    public String getStatus() {
        return machine.getStatus();
    }

    @Override
    public void setPathStrategy(PathPlanningStrategy strategy) {
        machine.setPathStrategy(strategy);
    }

    @Override
    public void update(EnvironmentData data) {
        machine.update(data);
    }
}




